<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		
	</body>
	<script>
		// let a = '[{"val/ue":"1/23","label":"456"'
		// console.log(a)
		// console.log(typeof(a))
		// let b = JSON.parse(a)
		// console.log(typeof(b))
		// console.log(b[0])
		// let str = '2014/06/01 00:00:00'
		// // str.replace(/\//g, "-");
		// // console.log(str
		// console.log(str.replace(/\//g,'-')) //替换为aaa
		// console.log('ba'+ +"m"+"a")
		// let str = 'hmw/plant/save.hmi'
		// console.log()
		let str = "2019-11-28 00:00:00"
		let num = str.indexOf(' ')
		console.log(str.substr(0, num))
	</script>
</html>

line: {
        legend: {
          left: 'left',
          data: ['Forest', 'Steppe', 'Desert', 'Wetland']
        },
        tooltip: {
          trigger: 'axis'
        },
        category: {
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri']
        },
        line: [
          {
            name: 'Forest',
            type: 'bar',
            barGap: 0,
            data: [320, 332, 301, 334, 390]
          },
          {
            name: 'Steppe',
            type: 'bar',
            data: [220, 182, 191, 234, 290]
          },
          {
            name: 'Desert',
            type: 'bar',
            data: [150, 232, 201, 154, 190]
          },
          {
            name: 'Wetland',
            type: 'bar',
            data: [98, 77, 101, 99, 40]
          }
        ]
      },
	  
	  
	  var posList = [
	      'left', 'right', 'top', 'bottom',
	      'inside',
	      'insideTop', 'insideLeft', 'insideRight', 'insideBottom',
	      'insideTopLeft', 'insideTopRight', 'insideBottomLeft', 'insideBottomRight'
	  ];
	  
	  app.configParameters = {
	      rotate: {
	          min: -90,
	          max: 90
	      },
	      align: {
	          options: {
	              left: 'left',
	              center: 'center',
	              right: 'right'
	          }
	      },
	      verticalAlign: {
	          options: {
	              top: 'top',
	              middle: 'middle',
	              bottom: 'bottom'
	          }
	      },
	      position: {
	          options: echarts.util.reduce(posList, function (map, pos) {
	              map[pos] = pos;
	              return map;
	          }, {})
	      },
	      distance: {
	          min: 0,
	          max: 100
	      }
	  };
	  
	  app.config = {
	      rotate: 90,
	      align: 'left',
	      verticalAlign: 'middle',
	      position: 'insideBottom',
	      distance: 15,
	      onChange: function () {
	          var labelOption = {
	              normal: {
	                  rotate: app.config.rotate,
	                  align: app.config.align,
	                  verticalAlign: app.config.verticalAlign,
	                  position: app.config.position,
	                  distance: app.config.distance
	              }
	          };
	          myChart.setOption({
	              series: [{
	                  label: labelOption
	              }, {
	                  label: labelOption
	              }, {
	                  label: labelOption
	              }, {
	                  label: labelOption
	              }]
	          });
	      }
	  };
	  
	  
	  var labelOption = {
	      normal: {
	          show: true,
	          position: app.config.position,
	          distance: app.config.distance,
	          align: app.config.align,
	          verticalAlign: app.config.verticalAlign,
	          rotate: app.config.rotate,
	          formatter: '{c}  {name|{a}}',
	          fontSize: 16,
	          rich: {
	              name: {
	                  textBorderColor: '#fff'
	              }
	          }
	      }
	  };
	  
	  option = {
	      color: ['#003366', '#006699', '#4cabce', '#e5323e'],
	      tooltip: {
	          trigger: 'axis',
	          axisPointer: {
	              type: 'shadow'
	          }
	      },
	      legend: {
	          data: ['Forest', 'Steppe']
	      },
	      toolbox: {
	          show: true,
	          orient: 'vertical',
	          left: 'right',
	          top: 'center',
	          feature: {
	              mark: {show: true},
	              dataView: {show: true, readOnly: false},
	              magicType: {show: true, type: ['line', 'bar', 'stack', 'tiled']},
	              restore: {show: true},
	              saveAsImage: {show: true}
	          }
	      },
	      calculable: true,
	      xAxis: [
	          {
	              type: 'time',
	              axisLabel:{
	                  interval: '0',
	                  formatter: function (value, index) {
	                     var date = new Date(value);
	                     var texts = [date.getFullYear(), (date.getMonth() + 1), date.getDate()];
	                     return texts.join('/');
	                  }
	              }
	          }
	      ],
	      yAxis: [
	          {
	              type: 'value'
	          }
	      ],
	      series: [
	          {
	              name: 'Forest',
	              type: 'bar',
	              barGap: 0,
	              label: labelOption,
	              data: [[2012, 320], [2013, 332], [2014, 301], [2015, 334], [2020, 390]]
	          },
	          {
	              name: 'Steppe',
	              type: 'bar',
	              label: labelOption,
	              data: [[2012, 220], [2013, 182], [2014, 191], [2015, 234], [2016, 290]]
	          }
	      ]
	  };
